<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>添加需求分析信息</title>
<link rel="stylesheet" type="text/css" href="skin/css/base.css">
</head>
<script src="jquery/jquery-3.0.0.min.js"></script>
<script>

	$(function () {
	    $.ajax({
            type: "POST",
			dataType:"json",
            url: "${pageContext.request.contextPath}/GetAllProjectServlet",
            success:function (msg) {
				$.each(msg,function (index,ele) {
					$("select").append("<option value=\'"+ele.project_id+"\'>"+ele.project_name+"</option>");
				});
            }
        });
	    $("select[name=project_id]").val($("select[name=project_id] option").val());
        $("a[name=baocun]").click(function () {
			var value = {
				project_id:$("select[name=project_id] option").val(),
                title:$("input[name=title]").val(),
				simple_desc:$("textarea[name=simple_desc]").val(),
				complex_desc:$("textarea[name=complex_desc]").val(),
				remark:$("textarea[name=remark]").val()
			};
			// console.log(value);
			// console.log($("input[name=title]").val());
			// console.log($("textarea[name=simple_desc]").val());
			// console.log($("textarea[name=complex_desc]").val());
			// console.log($("textarea[name=remark]").val());
			// console.log($("select option[name=project_name]").val());
			// console.log($("select[name=project_id]").val());
			// console.log($("form[name=from2]").serialize());
			$.ajax({
				type:"POST",
				url:"${pageContext.request.contextPath}/ProjectneedaddServlet",
				dataType:"json",
				data: value,<!--$("form[name=from2]").serialize()-->
				success:function () {
					alert("yes");
				},
				err:function(){
					alert("出问题了");
				}
			})
		})
	})
</script>
<body leftmargin="8" topmargin="8" background='skin/images/allbg.gif'>

<!--  快速转换位置按钮  -->
<table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA" align="center">
<tr>
 <td height="26" background="skin/images/newlinebg3.gif">
  <table width="58%" border="0" cellspacing="0" cellpadding="0">
  <tr>
  <td >
    当前位置:项目管理>>添加需求分析基本信息
 </td>
 </tr>
</table>
</td>
</tr>
</table>

<form name="form2">

<table id="form2-table" width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
<tr bgcolor="#E7E7E7">
	<td height="24" colspan="2" background="skin/images/tbg.gif">&nbsp;添加新需求&nbsp;</td>
</tr>
<tr >
	<td align="right" bgcolor="#FAFAF1" height="22">选择项目：</td>
	<td  align='left' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22"><select name="project_id"></select></td><!-- <option value=1>农业银行自助管理系统</option> -->
</tr>
<tr >
	<td align="right" bgcolor="#FAFAF1" height="22">标题：</td>
	<td  align='left' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22"><input name="title"/></td>
</tr>
<tr >
	<td align="right" bgcolor="#FAFAF1" height="22">简单描述：</td>
	<td align='left' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22"><textarea name="simple_desc" rows=10 cols=130></textarea></td>
</tr>
<tr >
	<td align="right" bgcolor="#FAFAF1" height="22">详细描述：</td>
	<td align='left' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22"><textarea name="complex_desc" rows=15 cols=130></textarea></td>
</tr>

<tr >
	<td align="right" bgcolor="#FAFAF1" >备注：</td>
	<td colspan=3 align='left' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" >
		<textarea name="remark" rows=10 cols=130></textarea>
	</td>
</tr>


<tr bgcolor="#FAFAF1">
<td height="28" colspan=4 align=center>
	&nbsp;
	<a name="baocun" href="project-need.jsp" class="coolbg">保存</a><!-- href="project-need.jsp" -->
	<a href="project-need.jsp" class="coolbg">返回</a>
</td>
</tr>
</table>

</form>
  

</body>
</html>